@extends("layouts.app")
@section('content')
    <section class="content-header">
        <h1>
            用户管理
        </h1>
        <ol class="breadcrumb">
            <li><a href="/dashboard"><i class="fa fa-dashboard"></i>家</a></li>
            <li><a href="#">用户管理</a></li>
            <li class="active">用户列表</li>
        </ol>
    </section>
    <section class="content">
                <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">搜索</h3>
                        <div class="box-tools"></div>
                    </div>
                    <div class="box-body">
                        <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <form class="form-inline" role="form" method="get" id="frmSearch">
                        <div class="form-group">
                            <input type="text" name="openid" class="form-control input-sm" style="width:9em" placeholder="请输入openid">
                        </div>&nbsp;
                       &nbsp;
                        <input type="submit" class="btn  btn-success" value="搜索">&nbsp;
                    </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
    <script>
        
        $(function(){
            
            var search = location.search.substring(1);
            if (search) {
                try {
                    var query = JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');

                    $.each(query, function(k, v) {
                        $('[name=' + k + ']').val(v);
                    });
                } catch (e) {
                    console.log(e);
                }

            }
        })
    </script>
        <div class="row">
            <div class="col-sm-12">
                <div class="box">
                    <div class="box-header with-border box-danger">
                        <h3 class="box-title">用户列表</h3>
                    </div>

                <!-- /.box-body -->
                    <div class="box-body">
                        <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                            <div class="row">
                                <div class="col-sm-6"></div>
                                <div class="col-sm-6"></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="example2" class="table table-bordered table-hover dataTable text-center" role="grid"
                                           aria-describedby="example2_info">
                                        <thead>
                                        <tr role="row">

                                            <th class="sorting col-sm-2" aria-controls="example2" rowspan="1"
                                                colspan="1"
                                                aria-label="Engine version: activate to sort column ascending">
                                                openid
                                            </th>
                                            <th class="sorting col-sm-2" aria-controls="example2" rowspan="1"
                                                colspan="1"
                                                aria-label="Engine version: activate to sort column ascending">
                                                积分
                                            </th>
                                            <th class="sorting col-sm-2" aria-controls="example2" rowspan="1"
                                                colspan="1"
                                                aria-label="Engine version: activate to sort column ascending">
                                                操作状态
                                            </th>
                                            <th class="sorting col-sm-2" aria-controls="example2" rowspan="1"
                                                colspan="1"
                                                aria-label="Engine version: activate to sort column ascending">
                                                添加时间
                                            </th>

                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($list as $value)
                                            <tr role="row" class="odd">

                                                <td>{{$value->openid}}</td>
                                                <td>{{$value->integral}}</td>
                                                <td>@if($value->type == '1')成功@else失败@endif</td>
                                                <td>{{$value->created_at}}</td>


                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            @include("layouts.page",['paginator'=>$list])
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <script src="{{env('URL_SUB', '')}}/bower_components/AdminLTE/plugins/iCheck/icheck.min.js"></script>
    <script src="{{env('URL_SUB', '')}}/bower_components/AdminLTE/plugins/iCheck/icheck.js"></script>
@endsection
